import { createVipType, updateVipType,deleteVipType ,findVipTypeList , findVipTypeOne, findVipDeclareList, findVipDeclareOne, findMyVipDeclareList, auditVipDeclare,updateVipDeclare,payVip,findPayLog} from '@/api/vipManager'

const vipManager = {
    actions: {
        // 创建
        CreateVipType({ commit }, data) {
            return new Promise((resolve, reject) => {
                createVipType(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },

        // 修改
        UpdateVipType({ commit }, data) {
            return new Promise((resolve, reject) => {
                updateVipType(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },

        // 删除
        DeleteVipType({ commit }, data) {
            return new Promise((resolve, reject) => {
                deleteVipType(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },


        // 查询list
        FindVipTypeList({ commit },data) {
            return new Promise((resolve, reject) => {
                findVipTypeList(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },

        //单个查询
        FindVipTypeOne({ commit }, data) {
            return new Promise((resolve, reject) => {
                findVipTypeOne(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },

        //查询申报list
        FindVipDeclareList({ commit }, data) {
            return new Promise((resolve, reject) => {
                findVipDeclareList(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },
        
        //申请表查询单个
        FindVipDeclareOne({ commit }, data) {
            return new Promise((resolve, reject) => {
                findVipDeclareOne(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },

        //查询我的申报list
        FindMyVipDeclareList({ commit }, data) {
            return new Promise((resolve, reject) => {
                findMyVipDeclareList(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },

         //审核申报
         AuditVipDeclare({ commit }, data) {
            return new Promise((resolve, reject) => {
                auditVipDeclare(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },

         //修改申报
         UpdateVipDeclare({ commit }, data) {
            return new Promise((resolve, reject) => {
                updateVipDeclare(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },

         //会员缴费
         PayVip({ commit }, data) {
            return new Promise((resolve, reject) => {
                payVip(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        },
        
        //查询支付结果
        FindPayLog({commit},data){
            return new Promise((resolve, reject) => {
                findPayLog(data).then(response => {
                    resolve(response)
                }).catch(error => {
                    reject(error)
                })
            })
        }

    }
}

export default vipManager
